//
//  SLSuccessAlertView.m
//  SlockApp
//
//  Created by 凯朱 on 2024/7/10.
//

#import "SLSuccessAlertView.h"

@implementation SLSuccessAlertView
-(void)awakeFromNib{
    [super awakeFromNib];
    self.backgroundColor = [UIColor colorWithRed:12/255.0 green:12/255.0 blue:12/255.0 alpha:0.8];
    _bgView.layer.cornerRadius = 30;
    _bgView.layer.masksToBounds = YES;
    _btn1.layer.cornerRadius = 25;
    _btn1.layer.masksToBounds = YES;
    _btn1.btnStyle = 1;
    
    [_btn1 setTitle:kLocalString(@"OK") forState:UIControlStateNormal];
    
}

-(void)setBtnTitle:(NSString *)btnTitle {
    [_btn1 setTitle:btnTitle forState:UIControlStateNormal];
}

- (IBAction)btnAction:(id)sender {
    if (_btnBlock) {
        _btnBlock(1);
    }
}

-(void)updateHeight{
    CGSize size = STRING_SIZE_FONT(kScreenWidth-120, _contentLbl.text, kFont(16));
    if (size.height > 45) {
        _bgViewHeight.constant = 370+size.height-40;
    }
}



@end
